package com.laf.manage.enums;

import lombok.Getter;

@Getter
public enum ProofTypeEnum {
    ID_CARD("1", "身份证"),
    FACE_IMAGE("2", "人脸图片");

    private String code;
    private String desc;

    ProofTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(String code) {
        for (ProofTypeEnum proofTypeEnum : ProofTypeEnum.values()) {
            if (proofTypeEnum.getCode().equals(code)) {
                return proofTypeEnum.getDesc();
            }
        }
        return null;
    }


    public static ProofTypeEnum getByCode(String code) {
        for (ProofTypeEnum proofTypeEnum : ProofTypeEnum.values()) {
            if (proofTypeEnum.getCode().equals(code)) {
                return proofTypeEnum;
            }
        }
        return null;
    }
}
